<!DOCTYPE html>
<html>
    <head>
    	<div  class="snapshot-exclude">
        <title>Scrum Cool Tool</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <link rel="shortcut icon" href="/public/images/scrumTool.png">
        <link rel="stylesheet" href="/public/stylesheets/jqtransform.css">
        <link rel="stylesheet" href="/public/stylesheets/validationEngine.jquery.css"/>
        <link rel="stylesheet" href="/public/stylesheets/editableText.css"  />
        <link rel="stylesheet" href="/public/stylesheets/ToolBar.css">
        <link rel="stylesheet" href="/public/stylesheets/contentPage.css">
        <link rel="stylesheet" href="/public/stylesheets/jquery.gritter.css" />
        <link rel="stylesheet" href="/public/stylesheets/dailog_box.css" />
        <link rel="stylesheet" href="/public/stylesheets/jquery.stickynotes.css" />
        <link rel="stylesheet" href="/public/stylesheets/jquery.ui.potato.menu.css" />
		<link rel="stylesheet" href="/public/stylesheets/colorbox.css" />
		<link rel="stylesheet" href="/public/stylesheets/tipTip.css" />
		<link rel="stylesheet" href="/public/stylesheets/style_paginate.css" />
		#{get 'moreStyles' /} 
        <script src="/public/javascripts/editable.js">
        </script>
        <script src="/public/javascripts/jquery.stickynotes.js">
        </script>
        <script src="/public/javascripts/jquery-1.4.2.min.js">
        </script>
        <script src="/public/javascripts/jquery-ui-1.8.custom.min.js">
        </script>
        <script src="/public/javascripts/dragtable.js">
        </script>
        <script src="/public/javascripts/highcharts.js">
        </script>
        <script src="/public/javascripts/jquery.editableText.js">
        </script>
        <script src="/public/javascripts/jquery.ui.potato.menu-min.js">
        </script>
        <script src="/public/javascripts/dialog_box.js">
        </script>
        <script src="http://www.google.com/jsapi">
        </script>
        <script src="/public/javascripts/jquery.gritter.min.js">
        </script>
        <script src="/public/javascripts/jquery.jqtransform.js">
        </script>
        <script src="/public/javascripts/jquery.form.js">
        </script>
        <script src="/public/javascripts/jquery.validationEngine-en.js">
        </script>
        <script src="/public/javascripts/jquery.validationEngine.js">
        </script>
        <script src="/public/javascripts/jquery.validate.js">
        </script>
        <script src="/public/javascripts/jquery.editable-1.3.3.js">
        </script>
		<script src="/public/javascripts/jquery.colorbox-min.js">
		</script>
		<script src="/public/javascripts/quickpager.jquery.js">
		</script>
		<script src="/public/javascripts/jquery.tipTip.minified.js">
		</script>
        #{get 'moreScripts' /}
        <script>
            $(function(){
                $('form').jqTransform({
                    imgPath: 'public/stylesheets/img'
                });
            });
            $().ready(function(){
                $('form').validationEngine();
            });
        </script>
        <script>
            
            function showDialogHelper(title, message, callback, link, type){
                if (callback) {					
                    var mess = message + '<br/><br/><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a STYLE="text-decoration:none" href = "' + link + '"/><input type="submit" value="  Yes  " onclick = "hideDialog()"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="  No  " onclick = "hideDialog()"/>';
                    showDialog(title, mess, type, false);
                }
                else {
                    showDialog(title, message, type, false);
                }
            }
        </script>
        <script>
            //For notifications	"gritter"
            window.setInterval(function(){
                if ('${session.get("userId")}' != null) {
                    var test = '${session.get("userId")}';
                    
                    $.getJSON('@{Notifications.getNotification()}', {
                        userId: test
                    }, function(notify){
						//alert(notify);
                    	if ( notify != null){
							$.gritter.add({
                            title: notify.title,
                            text: notify.main,
							sticky: true
                       		});
						}
						else{
							return false;
						} 
                    });
                }
            }, 600);
			//For notifications "div element"
            window.setInterval(function(){
                if ('${session.get("userId")}' != null) {
                    var test = '${session.get("userId")}';
                    
                    $.getJSON('@{Notifications.getAllNotifications()}', {
                        userId: test
                    }, function(notify){
						//alert(notify);
                    	if ( notify != null){
							var num = notify;
							$('#noti_count').empty();
							$('#noti_count').append( num );
						}

                    });
                }
            }, 600);			
        </script>
        <script>
            $(document).ready(function(){
                var b = 1;
				var k=0;
				//hide the all of the element with class msg_body,msg_body1,msg_head2
			$(".msg_body1").hide();
			$(".msg_body").hide();
			$(".msg_head2").hide();
            //toggle the componenet with class msg_body
             $(".msg_h").click(function()
             {
			 	$(this).next(".msg_head2").slideToggle(500);
			 	$(this).next(".msg_body1").slideToggle(300);
				if(k==0)
				{
					$(".msg_head2").show("fast");
					k=1;
				}
				else{
					$(".msg_head2").hide("slow");
					k=0;
				}
				 
				 $(".msg_body").hide();
				
             });
			  $(".msg_head2").click(function()
             {
              $(this).next(".msg_body").slideToggle(300);
             });
			
                $("ul.smsubnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)
                $("ul.smtopnav li span").click(function(){ //When trigger is clicked...
                    if (b == 1) {
                        $(this).parent().find("ul.smsubnav").slideDown('fast').show(); //Drop down the subnav on click
                        b = 0;
                    }
                    else {
                        $(this).parent().find("ul.smsubnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
                        b = 1;
                    }
                    
                    //Following events are applied to the subnav itself (moving subnav up and down)
                    /*$(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click
                     
                     $("ul.topnav li span").click(function() {
                     }, function(){
                     $(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
                     });*/
                    //Following events are applied to the trigger (Hover events for the trigger)
                }).hover(function(){
                    $(this).addClass("subhover"); //On hover over, add class "subhover"
                }, function(){ //On Hover Out
                    $(this).removeClass("subhover"); //On hover out, remove class "subhover"
                });
                
            });
        </script>
        <ul id="menu" style="min-width:800px;">
            <li class="logo">
                <img style="float:left;" alt="" src="/public/images/2222.gif"/>
            </li>
			<li>
				&nbsp;		
			</li>
            <li>
                <a href="@{Admin.index()}">Home</a>
            </li>
			<li>
				&nbsp;		
			</li>
            <li>
                <a href="#">Projects</a>
                <ul>
                    <li>
                        <img class="corner_inset_left" alt="" src="/public/images/corner_inset_left.png"/><a href="@{Projects.showAllProjects()}">Projects List</a>
                        <img class="corner_inset_right" alt="" src="/public/images/corner_inset_right.png"/>
                    </li>
                    <li>
                        <a href="@{Projects.showMyProjects()}">My Projects</a>
                    </li>
                    <li>
                        <a href="@{Projects.createProjectPage()}">Create Project</a>
                    </li>
                    <li style="background-color:#222" class="last">
                        <img class="corner_left" alt="" src="/public/images/corner_left.png"/><img style="background-color:#222" class="middle" alt="" src="/public/images/dot.gif"/><img class="corner_right" alt="" src="/public/images/corner_right.png"/>
                    </li>
					
                </ul>
            </li>
			<li>
				&nbsp;		
			</li>
            <li>
                <a href="/about">About</a>
            </li>
			<li>
				&nbsp;		
			</li>
            <li class="searchContainer">
                <input type="text" id="value" name="value"/><a href="javascript:search()"><img src="/public/images/magnifier.png" alt="Search" border="0"/></a>
            	<script>
            		function search() {
						var value = $('#value').val();
						if (value != "") {
							window.location = "@{SearchEngine.search()}?value=" + value + "";
						} else {
							showDialogHelper("Error!", "You must enter some data to search for!",false,"error");
						}
					}
            	</script>
			</li>
            <li class="logo">
                <img style="float:left; margin-top:15px;" alt="" src="/public/images/menu_right.png"/>
            </li>
        </ul>
		#{if controllers.Users.isSystemAdmin()}
        <ul class="smtopnav">
            <li style="top:100px;">
                <a href="#"><img style="border:none" "left=30px" src="/public/images/scroll.png" width="20" height="20"/>Admin Control</a>
                <ul class="smsubnav">
                    <li>
                    <a href="@{Users.Requests()}">Requests</a>
				    </li>
                    <li>
                        <a href="@{RoleCRUD.list()}">Roles</a>
                    </li>
                    <li>
                        <a href="@{Tasks.index()}">Task Settings</a>
                    </li>
                    <li>
                        <a href="#">Projects</a>
                    </li>
                </ul>
            </li>
        </ul>
        #{/if}
		</div>
    </head>
    <body>
        <div id="page" style="min-width:800px;">
            <div id = "content">
                #{if flash.success}
                <script>
                    javascript: showDialog('Success', '${flash.success}', 'success');
                </script>
                #{/if}
                #{if flash.error}
                <script>
                    javascript: showDialog('Error', '${flash.error}', 'error');
                </script>
                #{/if}
                <div align="right">
                    ${session.get("userName")} | <a href = "@{Users.viewProfile()}">My Account</a>
                    | <a href = "@{Users.viewNotifications()}">My Notifications</a>
                    <sup>
                        <div id="noti_count" style="display: inline;">
                        </div>
                    </sup>
                    | <a class="link" href="@{Secure.logout()}" title="GoodBye! :)">logout</a>
                    <br>
                    <br>
                    <script>
                        $(function(){
                            $(".link").tipTip();
                        });
                    </script>
                </div>
                #{doLayout /}
            </div>
        </div>
        <div id="footer" style="min-width:800px;">
            Powered by <a href="http://www.playframework.org/" style="color:#96d700;">Play!</a>
            All Rights Reserved © CoolSoft 2010. Have Fun ;)
        </div>
        <script type="text/javascript">
            var uservoiceOptions = {
                /* required */
                key: 'coolscrum',
                host: 'coolscrum.uservoice.com',
                forum: '55644',
                showTab: true,
                /* optional */
                alignment: 'left',
                background_color: '#800080',
                text_color: 'white',
                hover_color: '#06C',
                lang: 'en'
            };
            
            function _loadUserVoice(){
                var s = document.createElement('script');
                s.setAttribute('type', 'text/javascript');
                s.setAttribute('src', ("https:" == document.location.protocol ? "https://" : "http://") + "cdn.uservoice.com/javascripts/widgets/tab.js");
                document.getElementsByTagName('head')[0].appendChild(s);
            }
            
            _loadSuper = window.onload;
            window.onload = (typeof window.onload != 'function') ? _loadUserVoice : function(){
                _loadSuper();
                _loadUserVoice();
            };
        </script>
    </body>
</html>